<%--
  Created by IntelliJ IDEA.
  User: Lenovo
  Date: 2025/9/10
  Time: 9:23
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <title>确认订单</title>
</head>
<body>
<h1>确认订单</h1>
<hr>
用户名:${user.username}
电话:${user.phone}
地址:${user.address}<br>
---------------------------------------------------------------------<br>
<table border="1">
    <tr>
        <th>序号</th>
        <th>商品名称</th>
        <th>商品数量</th>
        <th>商品总价</th>
    </tr>
    <c:forEach items="${cart.items}" var="item" varStatus="i">
        <tr>
            <td>${i.index+1}</td>
            <td>${item.product.name}</td>
            <td>${item.num}</td>
            <td>${item.price}</td>
        </tr>
    </c:forEach>
</table>
---------------------------------------------------------------------<br>
总计:${cart.price}元<br>
<a href="${pageContext.request.contextPath}/create.order">生成订单</a>
<a href="${pageContext.request.contextPath}/findAll.product">返回购物车</a><br>
<span style="color: red;">${msg}</span>
</body>
</html>

